/**
 * Copyright © 2016-2025 The Thingsboard Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "../../../../../../../../scss/constants";

:host {
  overflow: auto;
  height: 100%;
  max-height: 420px;

  .gradient-preview {
    width: 100%;
    padding: 40px 15px 0;
    .gradient-background {
      position: relative;
      height: 56px;
      border-radius: 8px;
    }
  }

  .gradient-settings {
    flex: 1;
    gap: 16px;
    display: flex;
    flex-direction: column;
  }

  .tb-add-gradient {
    margin-right: 92px;
    @media #{$mat-lt-lg} {
      margin-right: 52px;
    }
  }
}
::ng-deep {
  .gradient {
    display: flex;
    flex: 1;
    align-items: center;
    flex-direction: row;

    &-container {
      display: flex;
      flex: 1;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 8px;
      margin-right: 12px;
      border: 1px solid rgba(0, 0, 0, 0.12);
      border-radius: 6px;
      &-start, &-end {
        margin-right: 92px;
        @media #{$mat-lt-lg} {
          margin-right: 52px;
        }
      }

      .tb-gradient-text {
        width: 140px;
        @media #{$mat-xs} {
          width: 50px;
        }
      }
    }
    .start-gradient-container, .end-gradient-container, .list-gradient-container {
      display: flex;
      gap: 8px;
      .gradient-text {
        font-size: 14px;
        color: rgba(0, 0, 0, 0.38);
      }
      &-advanced {
        flex: 1;
        @media #{$mat-xs} {
          align-items: center;
        }
      }
    }
  }
  .gradient-background {
    .pointer {
      position: absolute;
      width: 8px;
      height: 60px;
      border-radius: 6px;
      top: -2px;
      border: 2px solid white;
      -webkit-box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.75);
      -moz-box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.75);
      box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.75);

      &.start {
        left: 1px;
      }

      &.end {
        right: 1px;
      }

      &-value {
        position: absolute;
        top: -40px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 24px;
        border-radius: 4px;
        background-color: rgba(0, 0, 0, 0.06);
        &-text {
          text-overflow: ellipsis;
          overflow: hidden;
          font-size: 14px;
          font-weight: 500;
        }
        &:after {
          content: "";
          bottom: -8px;
          position: absolute;
          width: 0;
          height: 0;
          border-left: 8px solid transparent;
          border-right: 8px solid transparent;
          border-top: 8px solid rgba(0, 0, 0, 0.06);
        }
      }
    }
  }
}
